/**
 * Copyright (c) 2017-2022 Rushang Co.Ltd All Rights Reserved.
 */
package com.rshang.rsdp.router;

import com.rshang.rsdp.service.IDmRsdlGsaService;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * 功能简介：公司路由控制器<br/>
 *
 * @author zhangjun
 * @create 2017年8月20日上午11:42:51
 */
@Controller
@RequiresRoles("管理员")
@RequestMapping("/system/gs")
public class GsRouter extends BaseRouter {

    @Autowired
    IDmRsdlGsaService service;

    @RequestMapping("")
    public ModelAndView index() {
        return new ModelAndView("system/gs_index");
    }

    /**
     * 新增公司
     */
    @RequestMapping("/add")
    public ModelAndView add() {
        return new ModelAndView("system/gs_add");
    }

    /**
     * 公司编辑
     */
    @RequestMapping("/edit")
    public ModelAndView edit() {
        ModelAndView view = new ModelAndView("system/gs_edit");
        view.addObject("result", service.get(request));
        return view;
    }
}
